/********************************************************/
/*	Copyright (C) 2016 Gong Li Bin			*/
/*	Project:	GlbCloud			*/
/*	Author:		gong_libin			*/
/*	Date:		2012_02_03			*/
/*	File:		MrSem.h				*/
/********************************************************/

#ifndef _MRSMR_H
#define	_MRSMR_H

#include "MrIpc.h"
#include <sys/sem.h>

typedef union tagMrSem
{
	int m_iValue;
	struct semid_ds* m_pstBuf;
	USHORT* m_psArray;
}MRSEM_U;

class CMrSem : public CMrIpc
{
public:
	CMrSem();
	virtual ~CMrSem();

	int MrSemAcquire();
	int MrSemRelease();
	int MrSemAttach(key_t iKey);

	virtual void MrIpcDelete();
	virtual int MrIpcCreate(key_t iKey);

protected:

private:
	int m_iSem;

};

#endif /* _MRSMR_H */
